<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	
	<div id="div1">
		
		<h1 id="h1">我是一个h1</h1>

		我是一个div

	</div>

<script>
	var div1 = document.getElementById('div1');

	div1.innerText = 'hello wbc';

	// var txt = div1.innerText || div1.textContent;

	// console.log(div1.textContent);
</script>
	
</body>
</html>